package com.room.search.web.rest;

import com.room.search.response.RoomResult;
import com.room.search.service.dto.ServerDTO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.net.UnknownHostException;

/**
 * By   : ghd.bright
 * Time : 2022/3/12
 * Description: 服务监控控制器
 */
@RestController
@RequestMapping("/api")
public class RoomServerResource {

    @PreAuthorize("@ss.hasPermi('monitor:server:list')")
    @GetMapping("/monitor/server")
    public RoomResult getInfo() throws UnknownHostException {
        ServerDTO server = new ServerDTO();
        server.copyTo();
        return RoomResult.success(server);
    }
}
